package mapper.user;

import org.apache.ibatis.annotations.Param;
import pojo.SysUser;
import pojo.SysUsers;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface SysUserMapper {
    //查询总记录数
    public int count();

    //查询用户列表
    public List<SysUser> getUserList();

    //根据用户姓名模糊查询用户
    public List<SysUser> getUserByRealName(String realName);

    //查询用户列表
    public List<SysUser> getUserListByPojo(SysUser sysUser);

    //查询用户列表
    public List<SysUser> getUserListByMap(Map<String,Object> userMap);

    //查询用户列表
    public List<SysUser> getUserListByParams(@Param("realName") String realName,@Param("roleId") int roleId);

    //查询用户列表包括角色名称
    public List<SysUsers> getUserListWithRoleName(SysUsers sysUsers);

    //根据角色id查询用户
    public List<SysUsers> getUserListByRoleId(@Param("roleId") Integer roleId);

    //根据用户id查询用户及相关地址
    public List<SysUsers> getUserAndAddressesByUserId(@Param("userId") Integer userId);

    //添加用户
    public int add(SysUser user);

    //修改用户
    public int modify(SysUser user);

    //修改个人密码
    public int updatePwd(@Param("id")Integer id,@Param("password")String pwd);

    //删除用户
    public int deleteUserById(@Param("id")Integer id);

    //查询用户列表
    public List<SysUser> selectList (@Param("realName")String realName,@Param("roleId")Integer roleId);

    public List<SysUser> selectListByChoose(@Param("realName") String realName, @Param("roleId") Integer roleId, @Param("account") String account,
                                            @Param("createdTime") Date createdTime);

    public List<SysUser> getUserByRoleIdArray(Integer[] roleId);

    public List<SysUser> getUserByRoleIdList(List<Integer> roleIdList);

    public List<SysUser> getUserByRoleIdMap(Map<String, Object> roleMap);

    public int update(SysUser sysUser);

    public List<SysUser> selectPageList(@Param("realName")String realName,@Param("roleId")Integer roleId,@Param("pageBegin")Integer pageBegin,@Param("pageSize")Integer pageSize);
}
